<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        .headline-content {
            padding: 5px 10px;
        }

        .tip{
            #background-color: #000;
            #opacity: 0.4;
        }
        .arrow {
            height: 55px;
            width: 100%;
        }
        .arrow img{
            width: 50px;
            float: right;
            margin-right: 17px;
            margin-top: 5px;
        }

        .tip-info-first{
            color: #000;
            font-size: 20px;
            height: 42px;
            line-height: 42px;
            padding: 0 12px;
            border-radius: 6px;
            background: #D9D7D7;
            float: right;
            margin-top: -4px;
            margin-right: 59px;
        }
        .tip-info-second {
            position: absolute;
            top: 30%;
            text-align: center;
            width: 100%;
        }
        .tip-info-second img {
            width: 80px;
            margin-bottom: 13px;
        }
        .tip-info-second .tip-info-content {
            display: block;
        }
        .tip-info-second span {
            display: block;
            height: 20px;
            line-height: 20px;
            margin-bottom: 10px;
            font-size: 20px;
        }

        .container .top {
            width: 100%;
            height: auto;
            margin-top: 36%;
            margin-bottom: 30%;
            text-align: center;
        }

        .container .logo{
            width: 159px;
        }
        .middle{
            text-align: center;
        }
        .middle .apple{
            padding: 0 10%;
        }
        .content{
            background:  #1095FD;
            color: #fff;
            border-radius: 25px;
            height: 51px;
            line-height: 50px;
        }

        .btn{
            font-size: 14px;
            cursor: pointer;
        }

        a{
            text-decoration:none;
            display: inline;
        }


    </style>
</head>
<body>
<div class="tip" style="display: none;">
    <div class="arrow">
        <img src="css/image/arrows.png">
    </div>
    <div class="tip-info-first">
        <span>1.点击右上角...</span>
    </div>
    <div class="tip-info-second">
        <img class="browser-logo" src="css/image/safari-logo.png">
        <span class="browser-name">2.用safari打开</span>
        <span>进入火眼财经APP</span>
    </div>

</div>

<div class="container" style="display: none;">
    <div class="top">
        <img class="logo" src="css/image/logo-new.png" />
    </div>
    <div class="middle">
        <div class="apple">
            <a href="${ios}" class="btn">
                <div class="content">
                    <span type="button" class="btn">立即下载</span>
                </div>
            </a>
        </div>
    </div>
    <div class="bottom">
    </div>
</div>

<script src="/js/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script type="text/javascript">
    $(function () {

        var userAgent = navigator.userAgent.toLowerCase();

        var browser = {
            versions: function () {
                var u = navigator.userAgent;
                return {//移动终端浏览器版本信息
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/),
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 //android终端或者uc浏览器
                };
            }()
        }

        //微信 ios
        if(userAgent.indexOf("micromessenger") != -1 && userAgent.indexOf("mac os") != -1 ) {
            //safari(浏览器)提示
            $(".browser-logo").attr("src", "css/image/safari-logo.png");
            $(".browser-name").html("2.用safari打开");
            $(".tip").css("display", "block");

        //微信 android
        } else if (userAgent.indexOf("micromessenger") != -1 &&  userAgent.indexOf("android") != -1 ) {
            // 浏览器提示
            $(".browser-logo").attr("src", "css/image/browser-logo.png");
            $(".browser-name").html("2.用浏览器打开");
            $(".tip").css("display", "block");

        //非微信 ios
        } else if (browser.versions.mobile && browser.versions.ios) {
            //自动跳转下载
            $.getJsonData("/api/setting/dictionary?keyNo=IOS_APP_ADDRESS").done(function (result) {
                var data = result.datas;
                if(data.length == 1) {
                    $(".btn").attr("href", data[0].keyValue);
                    window.location.href = data[0].keyValue;
                }
                //页面显示，下载按钮
                $(".container").css("display", "block");
            });

        //非微信 android
        } else {
            $.getJsonData("/api/setting/dictionary?keyNo=ANDROID_APP_ADDRESS").done(function (result) {
                var data = result.datas;
                if(data.length == 1) {
                    window.location.href = data[0].keyValue;
                } else {
                    $("body").html("暂无下载地址");
                }
            });
        }

    });
</script>
</body>
</html>